<template>
  <div class="app">
    <p>首页</p>
    <p>{{ imgData }}</p>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { onBeforeMount } from "vue";
import { getUser } from "../api/api";

const imgData = ref({
    name:"guqisi"
});
const show = () =>{
    console.log(456)
    getUser(
      {username:"guqisi"}
    ).then(res => {
        console.log(res)
    })
}

onBeforeMount(() => {
  console.log(123)
  show()
});
</script>


<style lang="less" scoped>
</style>